<?
	include "../db.php";

	session_start();

	if(isset($_GET['username']))
		$username = $_GET['username'];
	if(isset($_SESSION['username']))
		$session_username = $_SESSION['username'];

	if($username == $session_username)
	{
		$category = $_SESSION['category'];
				$query_category = "select * from $category where username = '$username'";
				$result_category = mysql_query($query_category);
				if($result_category)
				{
					$msg = "login successfully!!!";
					$rows_category = mysql_fetch_assoc($result_category);
					$id = $rows_category['id'];
					$name = $rows_category['username'];
				}
		
		else
		{
			header("location:../login/login.php?msg=don't do it next time1!!!");
		}
	}
	else
	{
		header("location:../login/login.php?msg=don't do it next time2!!!");
	}
	echo $msg." welcome $id $name!!!<br />";

	echo "<a href = '../logout.php'>logout</a><br />";
	echo "<a href = 'profile_view.php?username=$username'>profile</a><br />";
	echo "<a href = 'profile_update.php?username=$username'>update profile</a><br />";

?>
